﻿/***********************************************************************
 * <copyright file="UserModel.cs" company="B/S JSC">
 * -->    Copyright (C) statement. All right reserved
 * </copyright>
 * 
 * Created:   Hoang Bich Son 
 * Email:    sonhb@newman.vn
 * Website:
 * Create Date: Saturday, March 29, 2014
 * Usage: 
 * 
 * RevisionHistory: 
 * Date         Author               Description 
 * 
 * ************************************************************************/

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace DxMvcApplication.Areas.Administrator.Models
{
    public class UserModel
    {
        /// <summary>
        /// Gets or sets the user identifier.
        /// </summary>
        /// <value>
        /// The user identifier.
        /// </value>
        [HiddenInput]
        public int UserId { get; set; }

        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        /// <value>
        /// The name.
        /// </value>
        [Display(ResourceType = typeof(NmResources.AdminResource), Name = "lbUserName")]
        [DataType(DataType.Text)]
        [Required(ErrorMessageResourceType = typeof(NmResources.MessageResource), ErrorMessageResourceName = "Required")]
        public string UserName { get; set; }

        /// <summary>
        /// Gets or sets the password.
        /// </summary>
        /// <value>
        /// The password.
        /// </value>
        [Display(ResourceType = typeof(NmResources.AdminResource), Name = "lbPassword")]
        [DataType(DataType.Password)]
        [Required(ErrorMessageResourceType = typeof(NmResources.MessageResource), ErrorMessageResourceName = "Required")]
        [MinLength(6, ErrorMessageResourceType = typeof(NmResources.MessageResource), ErrorMessageResourceName = "StringLength50")]
        public string Password { get; set; }

        /// <summary>
        /// Gets or sets the confirm password.
        /// </summary>
        /// <value>
        /// The confirm password.
        /// </value>
        [Display(ResourceType = typeof(NmResources.AdminResource), Name = "lbConfirmPassword")]
        [DataType(DataType.Password)]
        [Required(ErrorMessageResourceType = typeof(NmResources.MessageResource), ErrorMessageResourceName = "Required")]
        [System.ComponentModel.DataAnnotations.Compare("Password")]
        public string ConfirmPassword { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether [is active].
        /// </summary>
        /// <value>
        ///   <c>true</c> if [is active]; otherwise, <c>false</c>.
        /// </value>
        /// [Display(Name = "Tên tài khoản")]
        [Display(ResourceType = typeof(NmResources.AdminResource), Name = "lbActive")]
        public bool IsActive { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether [is approved].
        /// </summary>
        /// <value>
        ///   <c>true</c> if [is approved]; otherwise, <c>false</c>.
        /// </value>
        [Display(ResourceType = typeof(NmResources.AdminResource), Name = "lbIsApproved")]
        public bool IsApproved { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether [is blocked].
        /// </summary>
        /// <value>
        ///   <c>true</c> if [is blocked]; otherwise, <c>false</c>.
        /// </value>
        [Display(ResourceType = typeof(NmResources.AdminResource), Name = "lbBlock")]
        public bool IsBlocked { get; set; }
        /// <summary>
        /// Gets or sets the last activity date.
        /// </summary>
        /// <value>
        /// The last activity date.
        /// </value>
        [Display(ResourceType = typeof(NmResources.AdminResource), Name = "lbLastActivityDate")]
        [DataType(DataType.DateTime)]
        public DateTime LastActivityDate { get; set; }

        /// <summary>
        /// Gets or sets the full name.
        /// </summary>
        /// <value>
        /// The full name.
        /// </value>
        [Display(ResourceType = typeof(NmResources.AdminResource), Name = "lbFullName")]
        [DataType(DataType.Text)]
        [Required(ErrorMessageResourceType = typeof(NmResources.MessageResource), ErrorMessageResourceName = "Required")]
        public string FullName { get; set; }

        /// <summary>
        /// Gets or sets the email.
        /// </summary>
        /// <value>
        /// The email.
        /// </value>
        [Display(ResourceType = typeof(NmResources.AdminResource), Name = "lbEmail")]
        [DataType(DataType.Text)]
        [Required(ErrorMessageResourceType = typeof(NmResources.MessageResource), ErrorMessageResourceName = "Required")]
        public string Email { get; set; }

        /// <summary>
        /// Gets or sets the address.
        /// </summary>
        /// <value>
        /// The address.
        /// </value>
        [Display(ResourceType = typeof(NmResources.AdminResource), Name = "lbAddress")]
        [DataType(DataType.Text)]
        public string Address { get; set; }

        /// <summary>
        /// Gets or sets the created date.
        /// </summary>
        /// <value>
        /// The created date.
        /// </value>
        [Display(ResourceType = typeof(NmResources.AdminResource), Name = "lbCreatedDate")]
        [DataType(DataType.DateTime)]
        public DateTime CreateDate { get; set; }

        /// <summary>
        /// Gets or sets the unit identifier.
        /// </summary>
        /// <value>
        /// The unit identifier.
        /// </value>
        public long UnitId { get; set; }

        /// <summary>
        /// Gets or sets the roles.
        /// </summary>
        /// <value>
        /// The roles.
        /// </value>
        [Display(ResourceType = typeof(NmResources.AdminResource), Name = "lbRole")]
        public List<string> Roles { get; set; }
    }
}